﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Bill.View.aspx.cs" Inherits="BillView"
    EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <script src="assets/js/jquery-1.4.2.js" type="text/javascript"></script>
    <script src="assets/jquery/jquery.printElement.js" type="text/javascript"></script>
    <link rel="stylesheet" href="assets/css/billexport.css" type="text/css" />
    <style type="text/css">
        
    </style>
    <script type="text/javascript">
        function getUrlVars() {
            var vars = {};
            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                vars[key.toLowerCase()] = value;
            });
            return vars;
        }
        function printElem(options) {
            $('#body-wrapper').printElement(options);

        }
        $(document).ready(function () {
            $("#Print").click(function () {
                var vid = getUrlVars()['id'];
                window.open("./Bill.Print.aspx?id=" + vid, "mywindow", "menubar=0,status=0,directories=0,resizable=1,scrollbars=1,width=720,height=500");
            });

            $("#Export").click(function () {
                var vid = getUrlVars()['id'];
                window.open("./Bill.View.aspx?action=export&id=" + vid, "mywindow", "menubar=0,status=0,directories=0,resizable=1,scrollbars=1,width=720,height=500");
            });
            if (getUrlVars()['action'] == "export") {
                printElem({ overrideElementCSS: ['assets/css/billexport.css'] });
            }
        });
        
    </script>
</head>
<body>
    <div id="body-wrapper">
        <div id="main-content">
            <div class="content-box">
                <form id="frmEdit" runat="server">
                <%if (Request.QueryString["action"].ToString() != "export")
                  { %>
                <div class="content-box-header">
                    <h3>
                        VIEW BILL</h3>
                    <input id="Button1" type="button" style="float: right; margin: 9px 10px;" class="button"
                        value="&nbsp;&nbsp;Exit&nbsp;&nbsp;" onclick="window.close();" />
                    <input type="button" id="Print" class="button" runat="server" style="float: right;
                        margin: 9px 10px;" value="Print" />
                    <input type="button" id="Export" class="button" runat="server" style="float: right;
                        margin: 9px 10px;" value="Export" />
                    <asp:Button type="button" ID="btnExpPDF" class="button" runat="server" Style="float: right;
                        margin: 9px 10px; display: none;" Text="Export" OnClick="btnExpPDF_Click" />
                    <div class="clear">
                    </div>
                </div>
                <%} %>
                <div>
                    <table cellspacing="0" cellpadding="0" width="100%" style="border-top: 1px solid #CCCCCC;"
                        class="adminlist">
                        <tr>
                            <td colspan="3" style="width: 50%; text-align: center;">
                                <p class="billhead">
                                    <%--<img src="Assets/images/Logo_Blue_text_blue.png" alt="" height="60px" />--%>
                                    <h1>
                                        LOGO</h1>
                                </p>
                            </td>
                            <td style="vertical-align: top;" colspan="3">
                                <p style="font-size: 14px; margin-top: 10px;" class="billhead">
                                    BILL OF LADING FOR OCEAN TRANSPORT<br />
                                    OR MULTIMODAL TRANSPORT
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <p class="billhead">
                                    Shipper
                                </p>
                                <asp:Label ID="txtHBLSHPR" runat="server" Width="85%" TextMode="MultiLine" Rows="5"></asp:Label>
                            </td>
                            <td colspan="3">
                                <p class="billhead">
                                    B/L No.
                                </p>
                                <asp:Label ID="txtHBLNO" runat="server" Width="85%"></asp:Label>
                                <p class="billhead">
                                    Onward inland routing ( Not part of carriage as defined.
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <p class="billhead">
                                    Consignee (negotiable only if consigned "to order", "to order of" a named Person
                                    or "to order of bearer")
                                </p>
                                <asp:Label ID="txtHBLCNEE" runat="server" Width="85%" TextMode="MultiLine" Rows="5"></asp:Label>
                            </td>
                            <td colspan="3">
                                <p class="billhead">
                                    Notify Party
                                </p>
                                <asp:Label ID="txtHBLNTF" runat="server" Width="85%" Text="THE SAME AS CONSIGNEE"
                                    TextMode="MultiLine" Rows="5"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p class="billhead">
                                    Vesse
                                </p>
                                <asp:Label ID="txtVSSL" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td colspan="2">
                                <p class="billhead">
                                    Voyage No.
                                </p>
                                <asp:Label ID="txtVOYNO" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td colspan="3">
                                <p class="billhead">
                                    Place of Receipt
                                </p>
                                <asp:Label ID="txtPORID" runat="server" Width="85%"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p class="billhead">
                                    Port of loading
                                </p>
                                <asp:Label ID="txtPOLID" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td colspan="2">
                                <p class="billhead">
                                    Port of discharge
                                </p>
                                <asp:Label ID="txtPODID" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td colspan="3">
                                <p class="billhead">
                                    Port of Delivery
                                </p>
                                <asp:Label ID="txtDESTID" runat="server" Width="85%"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6" align="center">
                                PARTICULARS FURNISHED BY SHIPPER
                            </td>
                        </tr>
                    </table>
                    <asp:Repeater ID="rptShippingDetail" runat="server">
                        <ItemTemplate>
                            <tr>
                                <td class="contdetail" colspan="2">
                                    <asp:HiddenField ID="txtID" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "ID")%>'>
                                    </asp:HiddenField>
                                    <asp:Label ID="txtCONT" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "CONT")%>'
                                        CssClass="clsPol"></asp:Label>
                                    /&nbsp;<asp:Label ID="txtSEAL" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SEAL")%>'
                                        CssClass="clsPod"></asp:Label>
                                    /&nbsp;
                                    <asp:Label ID="txtContType" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ContType")%>'></asp:Label>
                                    /&nbsp;
                                    <asp:Label ID="txtPKGS" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PKGS")%>'></asp:Label>
                                    <%# Eval("PKGS") != "" ? "/" : ""%>
                                    &nbsp;
                                    <asp:Label ID="txtGW" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "GW")%>'></asp:Label>
                                    <%# Eval("GW") != "" ? "KGS / " : ""%>
                                    <asp:Label ID="txtMEAS" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "MEAS")%>'></asp:Label>
                                    <%# Eval("MEAS") != "" ? "CBM / " : ""%>
                                    <asp:Label ID="txtTEMP" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "TEMP")%>'></asp:Label>
                                    <%# Eval("TEMP") != "" ? "&deg;C " : ""%>
                                    </div>
                                </td>
                                <td colspan="2" class="contdetail">
                                </td>
                                <td colspan="2" class="contdetail">
                                </td>
                            </tr>
                        </ItemTemplate>
                        <HeaderTemplate>
                            <table cellspacing="0" cellpadding="0" width="auto" border="0" class="adminlist"
                                style="width: 100%; height: 360px;">
                                <thead>
                                    <tr>
                                        <td colspan="2" class="billhead" height="30px;">
                                            Kind of packages; Description of goods; Marks and Numbers; Container No./Seal No
                                        </td>
                                        <td style="width: 17%; text-align: center;" class="billhead" colspan="2">
                                            Gross Weight
                                        </td>
                                        <td style="width: 17%; text-align: center;" class="billhead" colspan="2">
                                            Measurement
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="border-bottom: none;" colspan="2">
                                            SHIPPER ' S LOAD, STOW, WEIGHT, COUNT & SEAL
                                            <p>
                                                <asp:Label ID="ddTypeOfMovement" runat="server" Style="width: 150px !important;"
                                                    CssClass="ddTypeOfMovement"></asp:Label>
                                                <%--<asp:DropDownList ID="ddTypeOfMovement" runat="server">
                                                                    <asp:ListItem Value="LCL/LCL - CFS/CFS" Text="LCL/LCL - CFS/CFS"></asp:ListItem>
                                                                    <asp:ListItem Value="FCL/FCL - CY/CY" Text="FCL/FCL - CY/CY"></asp:ListItem>
                                                                </asp:DropDownList>--%>
                                            </p>
                                        </td>
                                        <td style="width: 17%; border-bottom: none; text-align: center;" colspan="2">
                                            <% = spdGW_Sum>0 ? spdGW_Sum.ToString("#,#.00") + " KGS ":"" %>
                                        </td>
                                        <td style="width: 17%; border-bottom: none; text-align: center;" colspan="2">
                                            <% = spdMEAS_Sum>0 ? spdMEAS_Sum.ToString("#,#.00") + " CBM  ":"" %>
                                        </td>
                                    </tr>
                                </thead>
                        </HeaderTemplate>
                        <FooterTemplate>
                            <tr>
                                <td colspan="2" style="line-height: 16px; border-bottom: none; vertical-align: top;">
                                    <div>
                                        <p>
                                            <%=strGroupContType%>
                                            (<% = spdVOL_Sum > 1 ? "CONTAINERS" : "CONTAINER"%>) SAID TO CONTAIN:
                                        </p>
                                        <asp:Label ID="txtDOGMN" runat="server" TextMode="MultiLine" Rows="6"></asp:Label>
                                    </div>
                                </td>
                                <td colspan="2" style="border-bottom: none;">
                                </td>
                                <td colspan="2" style="border-bottom: none;">
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="vertical-align: bottom;">
                                    <p style="font-size: 30px; font-weight: bold; text-align: right;">
                                        DRAFT ONLY</p>
                                    <p>
                                        <div class="billhead">
                                        Above particulars as declared by shipper, but without responsibility of or representation
                                        by Carrier
                                    </p>
                                    </div>
                                </td>
                                <td colspan="2">
                                </td>
                                <td colspan="2">
                                </td>
                            </tr>
                            </TABLE>
                        </FooterTemplate>
                    </asp:Repeater>
                    <table cellspacing="0" cellpadding="0" width="100%" class="adminlist" style="border-buttom: 1px solid #CCCCCC;">
                        <tr>
                            <td>
                                <p class="billhead">
                                    Freight & Charges
                                </p>
                                <asp:Label ID="ddTOP" runat="server" Width="85%">
                                </asp:Label>
                            </td>
                            <td>
                                <p class="billhead">
                                    Rate
                                </p>
                                <asp:Label ID="txtRATE" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td>
                                <p class="billhead">
                                    Unit
                                </p>
                                <asp:Label ID="txtUNIT" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td>
                                <p class="billhead">
                                    Currency</p>
                                <asp:Label ID="txtCURR" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td>
                                <p class="billhead">
                                    Prepaid</p>
                                <asp:Label ID="txtPREPAID" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td>
                                <p class="billhead">
                                    Collect</p>
                                <asp:Label ID="txtCOLLECT" runat="server" Width="85%"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p class="billhead">
                                    Freight payable at
                                </p>
                                <asp:Label ID="txtPAYABLEAT" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td>
                                <p class="billhead">
                                    Place of issue of B/L
                                </p>
                                <asp:Label ID="txtPOISS" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td colspan="4" rowspan="3" width="450px">
                                <p class="billhead" style="font-size: 9px;">
                                    RECEIVED in apparent good order and condition except as otherwise noted the total
                                    number of containers of packages or units enumerated below for transportation from
                                    the place of receipt to the place of delivery subject to the terms hereof. One of
                                    the original Bill of Lading must be surrender duty endorsed in exchange for the
                                    Goods or delivery order on presentation of this docunment (duty endorsed) to the
                                    Carrier by or on behalf of the holder the rights and liabilities arising in accordance
                                    with the terms hereof shall (without prejudice to any rule of common law or statute
                                    rendering them binding on the merchant) become binding in all respects between the
                                    Carrier and the holders as though the contract evidenced hereby had been made between
                                    them. IN WITNESS whereof the number of original Bills of Lading stated below have
                                    been signed, one of which being accomplished the other(s) to be void.
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p class="billhead">
                                    Number & Original B(s)/L
                                </p>
                                <asp:Label ID="ddNOORI" runat="server" Width="85%"></asp:Label>
                            </td>
                            <td>
                                <p class="billhead">
                                    Date of issue of B/L
                                </p>
                                <asp:Label ID="txtDOISS" runat="server" Width="85%"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p class="billhead">
                                    Declare Value
                                </p>
                            </td>
                            <td>
                                <p class="billhead">
                                    Shipped on Board Date
                                </p>
                                <asp:Label ID="txtSHONBOARD" runat="server" Width="85%"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p class="billhead">
                                    For Delivery, Please Contact:
                                </p>
                                <asp:Label ID="txtAGDLVR" runat="server" Width="85%" TextMode="MultiLine" Rows="5"></asp:Label>
                            </td>
                            <td colspan="4" width="400px">
                                <p class="billhead">
                                    <b>AS AGENT ONLY FOR THE CARRIER: </b>
                                </p>
                                <asp:Label ID="txtCARRN" runat="server" Width="85%" TextMode="MultiLine" Rows="5"></asp:Label>
                                <p class="billhead">
                                    1. 2 working days are requested for taking orginal or surrender BLs since received
                                    yr payment
                                </p>
                                <p class="billhead">
                                    2. Shipper must submit the letter of introduction and ID card on our BLs release</p>
                                <p class="billhead">
                                    3. Checking particulars as done by Shipper, but withour responsibilities of Carrier
                                    or her (as) Agent
                                </p>
                            </td>
                        </tr>
                    </table>
                </div>
                </form>
            </div>
        </div>
    </div>
</body>
</html>
